<?php
$this->pageTitle = 'Thông tin tài khoản';
$this->breadcrumbs = array(
	'Ban quản trị' => array('index'),
	$model->username => array(),
	'Thông tin tài khoản',
);
$profile = $model->profile;
?>
<div class="heading">
    <h1><img src="<?php echo Util::themeUrl() ?>/images/header.ico" /><?php echo $this->pageTitle;?></h1>
    <div class="controls">
        <?php
            echo CHtml::link('Cập nhật thông tin', array('update'), array('class' => 'controls'));
            echo CHtml::link('Thay đổi mật khẩu', array('changepassword'), array('class' => 'controls'));
     ?>
    </div>
</div>

<div class="content">
	<div class="user-profile">
		<div class="left-column full-width">
			<div id="businessCardView" class="sliding-panel business-card showing-panel">
					<div class="border-gravatar"><?php echo CHtml::image(Util::getImageExist("avatar", $profile->avatar), "avatar",  array("class" =>"gravatar"));?></div>
					<h2>
						<?php echo CHtml::image(Util::getImageExist("avatar", (($profile->sex == SEX_BOY) ? ICONBOY : ICONGIRL)), "avatar",  array('title' => (($profile->sex == SEX_BOY) ? TITLE_BOY : TITLE_GIRL)));?>
						<?php echo Util::formatFullName($profile->fullname);?>
					</h2>
					<?php $age = Util::getAge($profile->birthday);?>
					<sub><?php echo ($age != '') ? ('(' . $age . ' tuổi)') : null;?></sub>
					<div>
						<table>
							<tr>
								<td><?php echo $profile->getAttributeLabel('birthday')?></td>
								<td><?php echo $profile->birthday;?></td>
							</tr>
							<tr>
								<td><?php echo $profile->getAttributeLabel('phone')?></td>
								<td><?php echo Util::formatPhone($profile->phone);?></td>
							</tr>
							<tr>
								<td><?php echo $profile->getAttributeLabel('cellphone')?></td>
								<td><?php echo Util::formatPhone($profile->cellphone);?></td>
							</tr>
							<tr>
								<td><?php echo $model->getAttributeLabel('email')?></td>
								<td><?php echo $model->email;?></td>
							</tr>
							<tr>
								<td><?php echo $profile->getAttributeLabel('address')?></td>
								<td><?php echo $profile->address;?></td>
							</tr>
							<tr>
								<td><?php echo $model->getAttributeLabel('status')?></td>
								<td><?php echo Util::itemAlias('UserStatus', $model->status);?></td>
							</tr>
							<tr>
								<td><?php echo $model->getAttributeLabel('create_at')?></td>
								<td><?php echo Util::formatTime($model->create_at);?></td>
							</tr>
							<tr>
								<td><?php echo $model->getAttributeLabel('lastvisit_at')?></td>
								<td><?php echo Util::formatTime($model->lastvisit_at);?></td>
							</tr>
						</table>
					</div>
			</div>
		</div>
	</div>
</div>